﻿using System;
using System.Globalization;
using ALC.Core.Enums;
using ALC.Views.Settings;
using WPFCommon.Converters;

namespace ALC.Converters
{
    public class SettingPageConverter : ValueConverterBase<SettingPageConverter>
    {
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var input = (SettingPageType) value;
            switch (input)
            {
                case SettingPageType.Position2D:
                    return new Poistion2DSettingView();
                case SettingPageType.Measure:
                    return new MeasureSettingView();
                case SettingPageType.Balance:
                    return new BalanceSettingView();
                case SettingPageType.Log:
                    return new LogSettingView();
            }
            
            throw new ArgumentException("No such setting page");
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}